﻿Ext.namespace('FantastPlatform', 'FantastPlatform.UI');
FantastPlatform.UI.WorkLogReplyGrid = function (config) {
    Ext.apply(this, config);
 

    this.items = [{
        layout: 'column',
        border: false,
        labelSeparator: '：',
        items: [
//        {
//            columnWidth: 1,
//            border: false,
//            layout: 'form',
//            items: [new Ext.form.TextField({
//                fieldLabel: '日志标题',
//                name: 'Title',
//                readonly: true,
//                anchor: '90%'
//            })]
//        },
         {
            columnWidth: 1,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextArea({
                fieldLabel: '日志内容',
                name: 'Content',
                readonly: true,
                anchor: '90%'
            })]
        }, {
            columnWidth: 1,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '创建人',
                name: 'PoliceMan',
                readonly: true,
                anchor: '90%'
            })]
        }, {
            columnWidth: 1,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '发表时间',
                name: 'CreateDate',
                readonly: true,
                anchor: '90%'
            })]
        }, {
            columnWidth: 1,
            border: false,
            layout: 'form',
            items: [new Ext.form.TextField({
                fieldLabel: '回复',
                name: 'ReplyContent',
                anchor: '90%'
            })]
        }
        ]
    }
    ];  
};

Ext.extend(FantastPlatform.UI.WorkLogReplyGrid, Ext.form.FormPanel, {
    onRender: function (ct, position) {
        FantastPlatform.UI.WorkLogReplyGrid.superclass.onRender.call(this, ct, position);
        if (this.Id && this.Id != 0) {
            this.add(new Ext.form.Hidden({ name: 'Id', value: this.Id }));          
            this.form.load({
                url: '../Service/WorkLogReply.aspx?Action=Get',
                params: { id: this.Id },
                waitMsg: '正在读取数据...',
                waitTitle: '请稍后...',
                failure: function (form, action) {
                    if (action.failureType != 'client') {
                        showErrorMessage('操作失败', action.result.message, '');
                    }
                }
            });


        }
    }
});